package com.uwo.house.service.serviceImpl;

import com.uwo.house.beans.request.HouseAddReq;
import com.uwo.house.beans.request.ModifySampleReq;
import com.uwo.house.beans.request.SampleHouseReq;
import com.uwo.house.beans.response.SampleHousesResp;
import com.uwo.house.dao.SampleHousesDao;
import com.uwo.house.service.ISampleHousesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by YZYG on 2017/7/19.
 */
@Service
public class SampleHousesService implements ISampleHousesService {
    @Autowired
    SampleHousesDao sampleHousesDao;

    public List<SampleHousesResp> getSampleHouses(SampleHouseReq sampleHouseReq) {
        return this.sampleHousesDao.getSampleHouses(sampleHouseReq);
    }

    public SampleHousesResp getSampleHouseById(int houseId) {
        return this.sampleHousesDao.getSampleHouseById(houseId);
    }

    public int addSampleHouses(HouseAddReq houseAddReq){
        return this.sampleHousesDao.addSampleHouses(houseAddReq);
    }

    public int updateSampleHouses(ModifySampleReq modifySampleReq) {
        return this.sampleHousesDao.updateSampleHouses(modifySampleReq);
    }

    public int deleteSampleHouses(int houseId) {
        return this.sampleHousesDao.deleteSampleHouses(houseId);
    }

    public List<SampleHousesResp> getSampleHousesByCondition(String province,String city,String blockName, String houseType, String space, String decorationStyle,
                                                             Double areaSizeFrom, Double areaSizeTo, BigDecimal dealPriceFrom, BigDecimal dealPriceTo,String searchKey) {
        return this.sampleHousesDao.getSampleHousesByCondition(province,city,blockName, houseType, space, decorationStyle,
                areaSizeFrom, areaSizeTo, dealPriceFrom, dealPriceTo,searchKey);
    }
}
